package com.lmaye.design.patterns.ood.lsp.comply;

/**
 * -- 测试
 *
 * <pre>
 *     1. 遵守里氏原则；
 * </pre>
 *
 * @author lmay.Zhou
 * @date 2020/11/12 20:06 星期四
 * @qq 379839355
 * @email lmay@lmaye.com
 * @since JDK1.8
 */
public class Test {
    public static void main(String[] args) {
        Animal ostrich = new Ostrich();
        ostrich.setRunSpeed(70);
        System.out.println("鸵鸟奔跑300公里需要" + ostrich.getRunTime(300) + "小时");
        Bird swallow = new Swallow();
        swallow.setRunSpeed(0.300);
        swallow.setFlySpeed(120);
        System.out.println("燕子奔跑1公里需要" + swallow.getRunTime(1) + "小时");
        System.out.println("燕子飞行300公里需要" + swallow.getFlyTime(300) + "小时");
    }
}
